package com.pbc.gmp.service.impl;

import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.pbc.gmp.commons.utils.PageInfo;
import com.pbc.gmp.dao.RoleMapper;
import com.pbc.gmp.model.basemodel.Brand;
import com.pbc.gmp.dao.BrandMapper;
import com.pbc.gmp.model.basemodel.Equipmenttype;
import com.pbc.gmp.model.mybatisDto.BrandInfo;
import com.pbc.gmp.service.IBrandService;

import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * InnoDB free: 9216 kB  服务实现类
 * </p>
 *
 * @author kjk
 * @since 2018-07-29
 */
@Service
public class BrandServiceImpl extends ServiceImpl<BrandMapper, Brand> implements IBrandService {

    @Resource(name="brandDao")
    private BrandMapper brandMapper;
    @Override
    public List<BrandInfo> selectBrandInfoList() {
        return brandMapper.selectBrandInfoList();
    }

    @Override
    public void selectBrandByDetailWhere(PageInfo pageInfo) {
        Page<Map<String, Object>> page = new Page<Map<String, Object>>(pageInfo.getNowpage(), pageInfo.getSize());
        List<BrandInfo> list = brandMapper.selectBrandByDetailWhere(page, pageInfo.getCondition());

        pageInfo.setRows(list);
        pageInfo.setTotal(page.getTotal());
    }
}
